//获取数据库的信息  用来初始化func菜单
$(document).ready(function () {
    $.ajax({
        type: "POST",
        dataType: "json",
        url: '/menuControl',
        success: function (result) {
            var objJson = eval(result);
            var number_count = objJson[0].number_count;
            // alert("number_count" + number_count);
            if (number_count == "on")
                document.getElementById("number_count").checked = true;
            else
                document.getElementById("number_count").checked = false;


            var joke = objJson[0].joke;
            if (joke == "on")
                document.getElementById("joke").checked = true;
            else
                document.getElementById("joke").checked = false;

            var chat = objJson[0].chat;
            if (chat == "on")
                document.getElementById("chat").checked = true;
            else
                document.getElementById("chat").checked = false;

            var story = objJson[0].story;
            if (story == "on")
                document.getElementById("story").checked = true;
            else
                document.getElementById("story").checked = false;

            var idiom_game = objJson[0].idiom_game;
            if (idiom_game == "on")
                document.getElementById("idiom_game").checked = true;
            else
                document.getElementById("idiom_game").checked = false;


            var brain_twists = objJson[0].brain_twists;
            if (brain_twists == "on")
                document.getElementById("brain_twists").checked = true;
            else
                document.getElementById("brain_twists").checked = false;

            var xiehouyu = objJson[0].xiehouyu;
            if (xiehouyu == "on")
                document.getElementById("xiehouyu").checked = true;
            else
                document.getElementById("xiehouyu").checked = false;

            var tongue_twister = objJson[0].tongue_twister;
            if (tongue_twister == "on")
                document.getElementById("tongue_twister").checked = true;
            else
                document.getElementById("tongue_twister").checked = false;

            var jingle = objJson[0].jingle;
            if (jingle == "on")
                document.getElementById("jingle").checked = true;
            else
                document.getElementById("jingle").checked = false;


            var weather = objJson[0].weather;
            if (weather == "on")
                document.getElementById("weather").checked = true;
            else
                document.getElementById("weather").checked = false;

            var date = objJson[0].date;
            if (date == "on")
                document.getElementById("date").checked = true;
            else
                document.getElementById("date").checked = false;

            var postcode = objJson[0].postcode;
            if (postcode == "on")
                document.getElementById("postcode").checked = true;
            else
                document.getElementById("postcode").checked = false;

        }
    });
})

